package com.hxzy.controller.anony.dictdata;

import com.hxzy.common.resp.R;
import com.hxzy.controller.anony.dictdata.resp.AnonyDictDataResp;
import com.hxzy.service.SysDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * 功能描述
 *
 * @author tonneyyy
 */
@Api(tags = "匿名-通用数据字典")
@RestController
@RequestMapping(value = "/anony/dictdata")
public class AnonyDictDataControler {

    @Autowired
    private SysDictDataService sysDictDataService;


    @ApiOperation(value = "根据字典类型查询字典数据")
    @GetMapping(value = "/searchByDictTypes")
    public R findDictTypes(String[] dictTypes){
        List<String> strings = Arrays.asList(dictTypes);
        Map<String,List<AnonyDictDataResp>> map = sysDictDataService.findDictTypes(strings);
        return R.success(map);
    }

}
